<template>
	<el-config-provider
		:button="{
			autoInsertSpace: true,
		}"
		:message="{
			max: 3,
		}"
		:size="size"
		:locale="locale"
	>
		<router-view />
	</el-config-provider>
</template>

<script setup>
import { computed, onUpdated } from "vue"
import { useRouter } from "vue-router"
import { ElMessage } from "element-plus"
import cnLocale from "element-plus/es/locale/lang/zh-cn"
import { useIndexedDBStore } from "/store/indexedDB"
import { useSettingStore } from "/store/setting"
import { useUserInfoStore } from "/store/userInfo"
import { useMenuStore } from "/store/menu"
import { useKeyHandleStore } from "/store/keyHandle"
useIndexedDBStore().init()
useKeyHandleStore().startKeyHandle()

const locale = computed(() => cnLocale)
const route = useRoute()
const router = useRouter()
const settingStore = useSettingStore()
const size = computed(() => settingStore.componentType.size)

const userInfoStore = useUserInfoStore()

window.setTimeout(function () {
	if (route.path != "/privacy") {
		userInfoStore.reloadUserInfo(true)
	}
}, 500)
</script>

<style lang="scss">
@import "./assets/style/index";
</style>
